package com.cody.service.impl;

import com.cody.dao.QuestionDao;
import com.cody.entity.Question;
import com.cody.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @author Cody
 * @date 2021/4/8 - 12:11
 */
@Service
public class QuestionServiceImpl implements QuestionService {
    @Autowired
    QuestionDao questionDao;
    @Override
    public List<Question> queryAllQuestion() {
        return questionDao.queryAllQuestion();
    }

    @Override
    public List<Question> queryAllQuestionByAdmin() {
        return questionDao.queryAllQuestionByAdmin();
    }

    @Override
    public List<Question>  queryQuestionByStudentId(String studentId) {
        return questionDao.queryQuestionByStudentId(studentId);
    }

    @Override
    public List<Question> queryQuestionsByTeacherId(String teacherNumber) {
        return questionDao.queryQuestionsByTeacherId(teacherNumber);
    }

    @Override
    public List<Question> queryQuestionByQuestionText(String questionText) {
        return questionDao.queryQuestionByQuestionText(questionText);
    }

    @Override
    public List<Question> queryQuestionByQuestionsubjectAndQuestionsection(String questionSubject, String questionSection) {
        return questionDao.queryQuestionByQuestionsubjectAndQuestionsection(questionSubject,questionSection);
    }

    @Override
    public Question queryQuestionByQuestionId(Integer QuestionId) {
        return questionDao.queryQuestionByQuestionId(QuestionId);
    }

    @Override
    public boolean insertQuestion(Question question) {
        return questionDao.insertQuestion(question);
    }

    @Override
    public boolean updateQuestion(Integer questionId) {
        return questionDao.updateQuestion(questionId);
    }

    @Override
    public boolean updQuestionInfo(Question question) {
        return questionDao.updQuestionInfo(question);
    }

    @Override
    public List<Question> queryQuestionByCommentSum() {
        return questionDao.queryQuestionByCommentSum();
    }

    @Override
    public boolean delQuestionByQuestionId(Integer questionId) {
        return questionDao.delQuestionByQuestionId(questionId);
    }
  @Override
public  List<String> queryQuestionByQuestionSection(){
return questionDao.queryQuestionByQuestionSection();
}

    @Override
    public List<Question> queryQuestionByKeyword(String keyword) {
        return questionDao.queryQuestionByKeyword(keyword);
    }

    @Override
public List<String> queryQuestionByQuestionSubject(){
  return questionDao.queryQuestionByQuestionSubject();

}

    @Override
    public List<HashMap<String,Object>>  queryQuestion() {
        return questionDao.queryQuestion();
    }
}
